@extends('layouts.admin_modal')

@section('content')
    <div class="box-body">
        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label">Name</label>

            <div class="col-sm-10">
                <input type="text" class="form-control" id="input-name" placeholder="Name" name="info[name]" value="{{ get_value($detail, 'name', '') }}">
            </div>
        </div>

        <div class="form-group">
            <label for="input-email" class="col-sm-2 control-label">Email</label>

            <div class="col-sm-10">
                <input type="email" class="form-control" id="input-email" placeholder="Email" name="info[email]" value="{{ get_value($detail, 'email', '') }}">
            </div>
        </div>

        <div class="form-group">
            <label for="input-password" class="col-sm-2 control-label">Password</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" id="input-password" placeholder="Password" name="info[password]" value="">
            </div>
        </div>

        <div class="form-group">
            <label for="input-password" class="col-sm-2 control-label">角色列表</label>
            <div class="col-sm-10">
                {{--<select class="form-control" name="role_id" id="role_id">
                    <option value="0">请选择管理员角色</option>
                    @foreach($roleList as $key=>$value)
                        <option value="{{ $value->id }}" @if(in_array($value->id, $roleIdList)) selected @endif>{{ $value->name }}</option>
                    @endforeach
                </select>--}}

                @foreach($roleList as $key=>$value)
                <label>
                    <input type="checkbox" class="flat-red" name="role_id[]" value="{{ $value->id }}" @if(in_array($value->id, $roleIdList)) checked @endif> {{ $value->name }}
                </label>
                @endforeach
            </div>
        </div>

    </div>

    <input type="hidden" name="info[id]" value="{{ get_value($detail, 'id') }}">

@endsection
@section('script')
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="{{ asset('plugins/iCheck/all.css') }}">
    <!-- iCheck 1.0.1 -->
    <script src="{{ asset('plugins/iCheck/icheck.min.js') }}"></script>
    <script>
        //Flat red color scheme for iCheck
        $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass   : 'iradio_flat-green'
        })
    </script>
@endsection